package testcase;

import java.util.ArrayList;

import org.junit.Test;
import control.CardController;
import control.ReadFile;
import entity.EventLog;
import entity.Card.Card;
import entity.Card.MCcard;
import entity.Card.SayAndAction;
import junit.framework.TestCase;

public class CardControllerTest extends TestCase{
	public class CardControllerStub extends CardController{};
	CardControllerStub testobj=new CardControllerStub();
	
	@Test
	public void testSeparateMCeffect(){
		ArrayList<int[]> toCompare = new ArrayList<int[]>();
		ReadFile mcF = new ReadFile("/CardInfo/mc_eng.txt");
		toCompare=testobj.separateMCEffect(mcF);
		assertNotNull(toCompare);
	}

	@Test
	public void testDisplayContent(){
		class Eventstub extends EventLog{};
		Eventstub estub=new Eventstub();
		Card testSayAndActcard=new SayAndAction("N",0,true);
		int testSayAndAct=testobj.displayContent(testSayAndActcard,estub);
		assertEquals(testSayAndAct,0);
		
		String[] choicetest=new String[4];
		choicetest[0]="N";
		choicetest[1]="N";
		choicetest[2]="N";
		choicetest[3]="N";
		int[] effectTest=new int[4];
		effectTest[0]=3;
		effectTest[1]=3;
		effectTest[2]=3;
		effectTest[3]=3;
		Card testMCCard=new MCcard("n",choicetest,effectTest,true);
		int testMC=testobj.displayContent(testMCCard,estub);
		assertEquals(3,testMC);
	}

}
